﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using App.Model.DTO.User;
using App.Model.Enum;
using SqlSugar;
namespace App.Model
{
    public class UserInfo : BaseId
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(16)")]
        public string UserName { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(12)")]
        public string NickName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(64)")]
        public string UserPassword { get; set; }
        /// <summary>
        /// 角色Id
        /// </summary>
        public string RoleId { get; set; }
        /// <summary>
        /// 角色类型
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public EnumUserRoleType RoleType { get; set; }
        /// <summary>
        /// 用户头像 服务器连接/file/AvatarImage
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string AvatarImage { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public EnumUserIsEnableType IsEnable { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Mobile { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateAt { get; set; }
        [SugarColumn(IsNullable = true)]
        public DateTime UpdateAt { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(RoleId))]
        public Role Role { get; set; }
    }
}
